<div class="card jb_vflex">
	<div class="card-header jb_vheader_card">
		<button onclick="ajaxSubmitForm('codeGenRouteForm')" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> 保存配置</button>
	</div>
	<div class="card-body jb_vbody">
		<form class="form" onsubmit="return false;" id="codeGenRouteForm" action="codegen/updatePRI" method="post">
			<input type="hidden" name="codeGen.id" value="#(codeGen.id)" autocomplete="off" />
			<input type="hidden" name="codeGen.isViewUsePath" value="#(codeGen.isViewUsePath?? true)" autocomplete="off" />
			<!--<div class="form-group row"
				data-radio
				data-rule="radio"
				data-value="#(codeGen.isViewUsePath?? 'true')"
				data-name="codeGen.isViewUsePath"
				data-default="true"
				>
				<label class="col-sm-2 col-form-label is_required" >启用Path注解</label>
				<div class="col"  style="padding-top: 1px;">
					<div class="radio radio-primary  radio-inline">
						<input  id="r_isViewUsePath_true" type="radio" name="codeGen.isViewUsePath"   value="true"/>
						<label for="r_isViewUsePath_true">启用</label>
					</div>

					<div class="radio radio-primary  radio-inline">
						<input  id="r_isViewUsePath_false" type="radio" name="codeGen.isViewUsePath"   value="false"/>
						<label for="r_isViewUsePath_false">不启用</label>
					</div>
				</div>
		 	</div>-->

			<div class="form-group row">
				<label class="col-sm-2 col-form-label">路由扫描包</label>
				<div class="col">
					<input type="text" data-link-para-ele="#projectModuleHiddenInput" data-with-clearbtn="true" data-autocomplete data-mustmatch="false" data-url="codegen/javaPackageAutocomplete" data-with-clearbtn placeholder="请输入需要扫描的package" class="form-control" name="codeGen.routesScanPackage" value="#(codeGen.routesScanPackage??)" autocomplete="off" />
					<small class="text-danger">注意：这个扫描包会生成到application模块下的临时路由配置里面：cn.jbolt.config.routes.ProjectCodeGenRoutesConfig中，可自行调整到cn.jbolt.config.ExtendProjectConfig中的configRoute中，如果是独立大模块，可以独立创建自己的Routes配置类在此配置</small>
				</div>
			</div>

<!--
			<div class="form-group row"
				data-radio
				data-rule="radio"
				data-value="#(codeGen.isNeedNewRoute?? 'false')"
				data-name="codeGen.isNeedNewRoute"
				data-default="false"
				>
				<label class="col-sm-2 col-form-label is_required" >需要新的Routes类？</label>
				<div class="col"  style="padding-top: 1px;">
					<div class="radio radio-primary  radio-inline">
						<input  id="r_isNeedNewRoute_true" type="radio" name="codeGen.isNeedNewRoute"   value="true"/>
						<label for="r_isNeedNewRoute_true">启用</label>
					</div>

					<div class="radio radio-primary  radio-inline">
						<input  id="r_isNeedNewRoute_false" type="radio" name="codeGen.isNeedNewRoute"   value="false"/>
						<label for="r_isNeedNewRoute_false">不启用</label>
					</div>
				</div>
		 	</div>

		 	<div class="form-group row">
				 <label class="col-sm-2 col-form-label">Routes路由类</label>
				<div class="col-6">
					<div class="input-group">
					<input data-width="600" id="routes_list_autocomplate" data-text-align="left" data-column-attr="text-500-left" type="text" autocomplete="off" data-mustmatch="false" data-autocomplete data-url="codegen/routesOptions/#(codeGen.id)" class="form-control"  placeholder="请选择Routes类"  data-tips="请选择Routes类"  maxlength="100" name="codeGen.routesClassName" value="#(codeGen.routesClassName??)">
					<div class="input-group-append">
						<span class="input-group-text"><a data-ajaxbtn data-input-id="routes_list_autocomplate" href="codegen/refreshRoutesCache" tooltip data-title="刷新路由数据" data-handler="flushTheAutocompleteCache"><i class="fa fa-refresh"></i></a></span>
					</div>
					</div>
				</div>
			</div>-->


<!--			<div class="form-group row"-->
<!--				data-radio-->
<!--				data-rule="radio"-->
<!--				data-value="#(codeGen.isNeedAdminInterceptor?? 'true')"-->
<!--				data-name="codeGen.isNeedAdminInterceptor"-->
<!--				data-default="true"-->
<!--				>-->
<!--				<label class="col-sm-2 col-form-label is_required" >后台权限拦截器</label>-->
<!--				<div class="col"  style="padding-top: 1px;">-->
<!--					<div class="radio radio-primary  radio-inline">-->
<!--						<input  id="r_isNeedAdminInterceptor_true" type="radio" name="codeGen.isNeedAdminInterceptor"   value="true"/>-->
<!--						<label for="r_isNeedAdminInterceptor_true">启用</label>-->
<!--					</div>-->

<!--					<div class="radio radio-primary  radio-inline">-->
<!--						<input  id="r_isNeedAdminInterceptor_false" type="radio" name="codeGen.isNeedAdminInterceptor"   value="false"/>-->
<!--						<label for="r_isNeedAdminInterceptor_false">不启用</label>-->
<!--					</div>-->
<!--				</div>-->
<!--		 	</div>-->

			<div class="form-group row">
				<label class="col-sm-2 col-form-label">额外拦截器配置</label>
				<div class="col">
					<div class="input-group">
						<input data-width="600" id="Interceptor_list_autocomplate" data-text-align="left" data-column-attr="text-500-left" type="text" autocomplete="off" data-mustmatch="false" data-autocomplete data-url="codegen/interceptorOptions/#(codeGen.id)" class="form-control"  placeholder="请选择拦截器"  data-tips="请选择拦截器"  maxlength="100" name="codeGen.extraInterceptorClassName" value="#(codeGen.extraInterceptorClassName??)">
						<div class="input-group-append">
							<span class="input-group-text"><a data-ajaxbtn data-input-id="Interceptor_list_autocomplate" href="codegen/refreshInterceptorCache" tooltip data-title="刷新拦截器数据" data-handler="flushTheAutocompleteCache"><i class="fa fa-refresh"></i></a></span>
						</div>
					</div>
					<small class="text-danger">请自行添加拦截器后 刷新缓存 配置后会在这次生成的Controller类中添加@Before(拦截器.class)注解</small>
				</div>
			</div>

		<fieldset id="permissionBox">
			<hr/>
			<div class="form-group row">
				<label class="col-6 col-form-label font-weight-bold text-center" style="font-size: 20px;">权限资源绑定配置</label>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 col-form-label">绑定已存在权限资源</label>
				<div class="col-sm-4">
					<input type="text"   autocomplete="off" name="demoUserName11" value="#(permission.name??)"  class="form-control"  placeholder="=选择已存在资源="
						   data-jboltinput
						   data-load-type="jstree"
						   data-url="codegen/permissionTreeDatas"
						   data-hidden-input="permissionId,permissionKey,permissionName,permissionIsMenu,permissionOfModule,permissionIsSystemAdminDefault"
						   data-jstree-value-attr="id,permissionKey,name,isMenu,ofModule,isSystemAdminDefault"
						   data-width="500"
					/>
				</div>

				<div class="col-auto">
					<button type="button" onclick="clearPermissionBind()" class="btn btn-outline-danger"><i class="fa fa-trash mr-1"></i> 清空权限</button>
				</div>
			</div>

			<div class="form-group row">
				<label class="col-sm-2 col-form-label">权限资源名称</label>
				<div class="col-6">
					<div class="input-group">
						<input type="text" id="permissionName" class="form-control" data-sync-attr="name" name="permission.name" value="#(permission.name??)"/>
					</div>
					<small class="text-danger">如果没有可选权限资源，就自己添加一个</small>
				</div>
			</div>

			<div class="form-group row">
				<label class="col-sm-2 col-form-label">权限资源KEY</label>
				<div class="col-6">
					<div class="input-group">
						<input type="text" id="permissionKey" class="form-control" data-sync-attr="permissionKey" name="permission.permissionKey" value="#(permission.permissionKey??)"/>
					</div>
					<small class="text-danger">如果没有可选权限资源，就自己添加一个</small>
				</div>
			</div>

			<div class="form-group row" id="permissionIsMenu"
				 data-radio
				 data-rule="radio"
				 data-value="#(permission.isMenu?? 'true')"
				 data-name="permission.isMenu"
				 data-default="true">
				<label class="col-sm-2 col-form-label is_required" >是否为菜单</label>
				<div class="col"  style="padding-top: 1px;">
					<div class="radio radio-primary  radio-inline">
						<input  id="r_ismenu_true" type="radio" name="permission.isMenu"   value="true"/>
						<label for="r_ismenu_true">菜单</label>
					</div>

					<div class="radio radio-primary  radio-inline">
						<input  id="r_ismenu_false" type="radio" name="permission.isMenu"   value="false"/>
						<label for="r_ismenu_false">非菜单</label>
					</div>
				</div>
			</div>

			<div class="form-group row" id="permissionIsSystemAdminDefault"
				 data-radio
				 data-rule="radio"
				 data-value="#(permission.isSystemAdminDefault?? 'true')"
				 data-name="permission.isSystemAdminDefault"
				 data-default="true">
				<label class="col-sm-2 col-form-label is_required" >是否为超管默认权限</label>
				<div class="col"  style="padding-top: 1px;">
					<div class="radio radio-primary  radio-inline">
						<input  id="r_isas_true" type="radio" name="permission.isSystemAdminDefault"   value="true"/>
						<label for="r_isas_true">是</label>
					</div>

					<div class="radio radio-primary  radio-inline">
						<input  id="r_isas_false" type="radio" name="permission.isSystemAdminDefault"   value="false"/>
						<label for="r_isas_false">否</label>
					</div>
				</div>
			</div>

			<div class="form-group row">
				<label class="col-sm-2 col-form-label">所属定义模块ofModule</label>
				<div class="col-3">
					<select class="form-control"
							data-autoload
							id="permissionOfModule"
							name="permission.ofModule"
							data-url="codegen/ofModules"
							data-text="=请选择="
							data-value=""
							data-refresh="true"
							data-tips="必须选择一个模块ofModule"
							data-select="#(permission.ofModule??)"
					></select>
				</div>
			</div>

			<input type="hidden" id="permissionId" class="form-control" data-sync-attr="id" name="codeGen.permissionId" value="#(codeGen.permissionId)"/>
		</fieldset>
		</form>
	</div>
</div>
<script>
	function clearPermissionBind(){
		LayerMsgBox.confirm("确定清空此模块接口绑定权限信息？",function(){
			$("#permissionBox input[type='text']").val("");
			$("#permissionBox input[type='hidden']").val("");
			$("#permissionBox select").val("");
		});
	}
</script>
